import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n= sc.nextInt();
        int[] arr=new int[2*n];
        for(int i=0;i< arr.length;i++){
            arr[i]=sc.nextInt();
        }
        int sum=0;
        Arrays.sort(arr);
        int left=0,right= arr.length-1;
        while (left<right){
            sum+=arr[left]*arr[right];
            left++;
            right--;
        }
        System.out.println(sum);
    }
}